<?php
namespace Home\Controller;

class CookbookController extends CommonController{
    
    public function index(){
        //食物百科
        $this->assign('cateArr',M('Resource')->where(array('type'=>'cookbook'))->order('id asc')->select());
        //最新的15个推荐食谱
        $this->assign('list',M('Cookbook')->where(array('rid'=>0))->order('id desc')->select());
        $this->display();
    }
    
    public function lists(){
        $this->assign('list',M('Cookbook')->where(array('rid'=>I('get.rid')))->select());
        $this->display();
    }
    
}